home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Functions_JScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.3 KB  |  59 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <!*************************
  4. This sample is provided for educational purposes only. It is not intended to be 
  5. used in a production environment, has not been tested in a production environment, 
  6. and Microsoft will not provide technical support for it. 
  7. *************************>
  8.  
  9.  
  10. <Script LANGUAGE=JScript RUNAT=Server>
  11.  
  12.     //Define Server Side Script Function.
  13.     function PrintOutMsg(strMsg, intCount)
  14.     {
  15.         var i ;
  16.         
  17.         //Output Message count times.
  18.         for(i = 0; i < intCount; i++)
  19.         {
  20.             Response.Write(strMsg + "<BR>");
  21.         }
  22.  
  23.         //Return number of iterations.        
  24.         return intCount;
  25.     }
  26.     
  27. </SCRIPT>
  28.  
  29.  
  30. <HTML>
  31.     <HEAD>
  32.         <TITLE>Functions</TITLE>
  33.     </HEAD>
  34.  
  35.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  36.         
  37.         <!-- Display header. -->
  38.  
  39.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  40.         <B>Server Side Functions</B></FONT><BR>   
  41.  
  42.         <P>
  43.         The function "PrintOutMsg" prints out a specific message a set number of times.
  44.         <P>
  45.         
  46.  
  47.         <%
  48.             var intTimes ;
  49.  
  50.             //Call Function.            
  51.             intTimes = PrintOutMsg("This is a function test!", 4);
  52.  
  53.             //Output the function return value.
  54.             Response.Write("<p>The function printed out the message " + intTimes + " times.");
  55.         %>
  56.  
  57.     </BODY>
  58. </HTML>
  59.